<template>
	<view>
		<view class="content" v-if="title == '购买明细'">
			<u-card :title="title" :foot-style="footStyle">
				<view slot="body">
					<view class="goodList" v-for="(item, index) in pagebox.detail" :key="index">
						<view class="itemLeft">
							<image :src="item.image" mode="aspectFit"></image>
						</view>
						<view class="itemRight">
							<view class="name">{{ item.goods_name }}</view>
							<view class="info">
								<view class="price">{{ item.price }}大王币</view>
								<view class="num">×{{ item.num }}</view>
							</view>
						</view>
					</view>
				</view>

				<view class="footer" slot="foot">
					<view>合计：<text style="color:#FFB02E;">{{ pagebox.order_money }}大王币</text></view>
				</view>
			</u-card>


			<u-card border-radius="0" :show-head="false" padding="40" margin="0">
				<view slot="body" class="orderInfo">
					<view>
						<view  style="color:#fff;">订单金额：</view>
						<view>
							<text></text>
							<text style="color:#FFB02E;">￥{{ pagebox.order_money }}</text>
						</view>
					</view>
					<view>
						<view style="color:#fff;">支出：</view>
						<view><text></text><text style="color:#FFB02E;">￥{{ pagebox.money }}</text></view>
					</view>
					<view>
						<view style="color:#fff;">当前余额：</view>
						<view><text></text><text style="color:#FFB02E;">￥{{ pagebox.balance }}</text></view>
					</view>
				</view>
			</u-card>

			<!-- <u-gap height="28" bg-color="#f9f9f9"></u-gap> -->


			<u-card border-radius="0" :show-head="false" padding="40" margin="0">
				<view slot="body" class="orderInfo">
					<view>
						<view style="color:#fff;">购买时间：</view>
						<view>
							<text></text>
							<text style="color:#fff;">{{ pagebox.create_time }}</text>
						</view>
					</view>
					<view>
						<view style="color:#fff;">购买类型：</view>
						<view>
							<text></text>
							<text style="color:#ffff;">{{ pagebox.show_type }}</text>
						</view>
					</view>
					<view>
						<view style="color:#fff;">购买数量:</view>
						<view>
							<text></text>
							<text style="color:#fff;">{{ pagebox.buy_num }}</text>
						</view>
					</view>
					<view>
						<view style="color:#fff;">订单编号:</view>
						<view>
							<text></text>
							<text style="color:#fff;">{{ pagebox.order_no }}</text>
							<text @click="fuzhi(pagebox.order_no)">复制</text>
						</view>
					</view>
				</view>
			</u-card>
			<!-- <u-gap height="28" bg-color="#f9f9f9"></u-gap> -->
		</view>

		<view class="content" v-if="title == '拒提明细'">
			<u-card :title="title" :foot-style="footStyle">
				<view slot="body">
					<view class="goodList" v-for="(item, index) in pagebox.detail.list" :key="index">
						<view class="itemLeft">
							<image :src="item.image" mode="aspectFit"></image>
						</view>
						<view class="itemRight">
							<view class="name">{{ item.prize_name }}</view>
							<view class="info">
								<view class="price" style="color:#FFB02E;">{{ item.recovery_price }}大王币</view>
								<view class="num" style="color:#fff;">×{{ item.num }}</view>
							</view>
						</view>
					</view>
				</view>

				<view class="footer" slot="foot">
					<view>合计：<text style="color:#FFB02E;">{{ pagebox.detail.total_money }}大王币</text></view>
				</view>
			</u-card>

			<!-- <u-gap height="28" bg-color="#f9f9f9"></u-gap> -->
			<u-card border-radius="0" :show-head="false" padding="40" margin="0">
				<view slot="body" class="orderInfo">
					<view>
						<view style="color:#fff;">拒提时间：</view>
						<view>
							<text></text>
							<text style="color:#fff;">{{ pagebox.create_time }}</text>
						</view>
					</view>
					<view>
						<view style="color:#fff;">收入:</view>
						<view><text></text><text style="color:#FFB02E;">{{ pagebox.money }} 大王币</text></view>
					</view>
				</view>
			</u-card>
			<!-- <u-gap height="28" bg-color="#f9f9f9"></u-gap> -->
		</view>

		<view class="content" v-if="title == '系统赠送'">
			<u-card border-radius="0" :show-head="false" padding="40" margin="0">
				<view slot="body" class="orderInfo">
					<view>
						<view style="color:#fff;">获赠时间：</view>
						<view>
							<text></text>
							<text style="color:#fff;">{{ pagebox.create_time }}</text>
						</view>
					</view>
					<view>
						<view style="color:#fff;">赠送人：</view>
						<view>
							<text></text>
							<text style="color:#fff;">{{ pagebox.show_type }}</text>
						</view>
					</view>
					<view>
						<view style="color:#fff;">收入:</view>
						<view>
							<text></text>
							<text style="color:#FFB02E;">{{ pagebox.money }} 大王币</text>
						</view>
					</view>
					<view>
						<view style="color:#fff;">当前余额:</view>
						<view>
							<text></text>
							<text style="color:#FFB02E;">{{ pagebox.balance }} 大王币</text>
						</view>
					</view>
				</view>
			</u-card>
		</view>

		<view class="content" v-if="title == '平台充值'">
			<u-card border-radius="0" :show-head="false" padding="40" margin="0">
				<view slot="body" class="orderInfo">
					<view>
						<view style="color:#fff;">充值时间：</view>
						<view>
							<text></text>
							<text style="color:#fff;">{{ pagebox.create_time }}</text>
						</view>
					</view>
					<view>
						<view style="color:#fff;">支付方式：</view>
						<view>
							<text></text>
							<text style="color:#fff;">{{ pagebox.pay_type }}</text>
						</view>
					</view>
					<view>
						<view style="color:#fff;">收入:</view>
						<view>
							<text></text>
							<text style="color:#FFB02E;">{{ pagebox.money }} 大王币</text>
						</view>
					</view>
					<view>
						<view style="color:#fff;">当前余额:</view>
						<view>
							<text></text>
							<text style="color:#FFB02E;">{{ pagebox.balance }} 大王币</text>
						</view>
					</view>
					<view>
						<view>
							<view style="color:#fff;">订单编号:</view>
							<view>
								<text></text>
								<text style="color:#fff;">{{ pagebox.order_no }}</text>
								<text @click="fuzhi(pagebox.order_no)" style="color:#fff;">复制</text>
							</view>
						</view>
					</view>
				</view>
			</u-card>
		</view>


	</view>
</template>

<script>
export default {
	data() {
		return {
			id: '',
			title: "",
			pagebox: [],//全部数据
			footStyle: {
				float: 'right'
			}
		}

	},
	onLoad(e) {
		this.id = e.id
	},
	onShow() {
		this.getlist()
	},
	methods: {
		fuzhi(e) {
			uni.setClipboardData({
				data: e.toString(),
				success: () => {
					uni.showToast({
						title: '复制成功'
					})
				}
			});
		},
		getlist() {
			this.$Request.get(this.$api.user.integralDetail, { id: this.id }).then(res => {
				if (res.data.form_id == 1 || res.data.form_id == 11) {
					this.title = '购买明细'
				} else if (res.data.form_id == 3) {
					this.title = "拒提明细"
				} else if (res.data.form_id == 4) {
					this.title = '系统赠送'
				} else if (res.data.form_id == 2) {
					this.title = '平台充值'
				}
				this.pagebox = res.data
			});
		}
	},
}
</script>

<style lang="scss" scoped>
/deep/.u-card{
	background: rgba(255, 231, 192, 0.1) !important;
		border-radius: 10rpx 10rpx 10rpx 10rpx !important;
		border: 1rpx solid #FED187 !important;
}
/deep/.u-card__head--left__title{
	color: #fff !important;
}
.content {
	width: 100vw;
	height: 100vh;
	background: #262626;
	padding-top: 39rpx;

	.goodList {
		font-family: PingFang SC;
		height: 288rpx;
		background: rgba(255, 231, 192, 0.1);
		border-radius: 10rpx 10rpx 10rpx 10rpx;
		opacity: 1;
		border: 1rpx solid #FED187;
		border-radius: 10px;
		display: flex;
		justify-content: space-between;
		align-items: center;

		.itemRight {
			flex: 1;
			height: 210rpx;

			.name {
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #fff;
				width: 300rpx;
				overflow: hidden;
				text-overflow: ellipsis;
				white-space: nowrap;
				-webkit-box-orient: vertical;

			}

			.info {
				display: flex;
				justify-content: space-between;
				align-items: center;
				margin-top: 91rpx;

				.price {
					font-size: 30rpx;
					font-weight: bold;
					color: #FFB02E;
				}

				.num {
					font-size: 26rpx;
					font-weight: 500;
					color: #fff;
					margin-right: 63rpx;
				}
			}
		}

		.itemLeft {
			width: 210rpx;
			height: 210rpx;
			border: 1px solid #FFAE2A;
			border-radius: 4px;
			display: flex;
			justify-content: center;
			align-items: center;
			margin-left: 61rpx;
			margin-right: 45rpx;


			i image {
				width: 150rpx;
				height: 150rpx;
			}
		}
	}

	.footer {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #fff;

		text {
			color: #FFB02E;
		}
	}

	.orderInfo {
		view {
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;
			margin-top: 10rpx;
			font-family: PingFang-SC-Medium;
			font-size: 28rpx;
			font-weight: 500;

			view:nth-child(1) {
				color: #000000;
			}

			view:nth-child(2) {
				color: #959595;
				text-align: right;

				text:nth-child(3) {
					font-size: 24rpx;
					font-weight: 500;
					color: #F46D13;
					width: 60rpx;
				}
			}
		}
	}
}
</style>
